﻿// Project: Salient
// http://salient.codeplex.com
// 
// Copyright 2010, Sky Sanders <sky at skysanders.net>
// Dual licensed under the MIT or GPL Version 2 licenses.
// http://salient.codeplex.com/license
// 
// Date: April 24 2010 

#region

using System.Net;
using System.Web.Script.Serialization;

#endregion


namespace Salient.Web.Hosting.ApplicationServices
{

    ///<summary>
    ///</summary>
    public static class AuthenticationServiceHelperEx
    {
    


        /// <summary>
        /// 
        /// </summary>
        /// <param name="server"></param>
        /// <param name="cookies"></param>
        /// <returns></returns>
        public static bool FormsIsLoggedInAppSvc(this IWebServer server, CookieContainer cookies)
        {
            return Salient.Web.ApplicationServices.AuthenticationServiceHelper.FormsIsLoggedInAppSvc(server.RootUrl, cookies);
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="server"></param>
        /// <param name="cookies"></param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="createPersistentCookie"></param>
        /// <returns></returns>
        public static bool FormsLoginAppSvc(this IWebServer server, CookieContainer cookies, string userName,
                                            string password, bool createPersistentCookie)
        {
            return Salient.Web.ApplicationServices.AuthenticationServiceHelper.FormsLoginAppSvc(server.RootUrl, cookies, userName, password, createPersistentCookie);
        }




        /// <summary>
        /// 
        /// </summary>
        /// <param name="server"></param>
        /// <param name="cookies"></param>
        public static void FormsLogoutAppSvc(this IWebServer server, CookieContainer cookies)
        {
            Salient.Web.ApplicationServices.AuthenticationServiceHelper.FormsLogoutAppSvc(server.RootUrl, cookies);
        }



    }
}